﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="queryExcept.aspx.cs" Inherits="WorkOrder.queryExcept" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>工单管理支持系统_服务支撑室</title>
    <link href="../css/left.css" type="text/css" rel="STYLESHEET" />
    <link href="../css/site2.css" type="text/css" rel="STYLESHEET" />
    <script type="text/javascript" src="../DatePicker/WdatePicker.js" defer="defer"></script>
    <script language="javascript" type="text/javascript">        //加在head中，PNG无灰色背景
        var tmp = window.navigator.userAgent.toLowerCase().indexOf("MSIE");
        //加在head中，PNG无灰色背景
        function correctPNG() {
            for (var i = 0; i < document.images.length; i++) {
                var img = document.images[i];
                var imgName = img.src.toUpperCase();
                if (imgName.substring(imgName.length - 3, imgName.length) == "PNG") {
                    var imgID = (img.id) ? "id='" + img.id + "' " : "";
                    var imgClass = (img.className) ? "class='" + img.className + "' " : "";
                    var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
                    var imgStyle = "display:inline-block;" + img.style.cssText;
                    if (img.align == "left") imgStyle = "float:left;" + imgStyle;
                    if (img.align == "right") imgStyle = "float:right;" + imgStyle;
                    if (tmp >= 1) {
                        if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
                    }
                    else {
                        if (img.parentNode.href) imgStyle = "cursor:hand;" + imgStyle;
                    }
                    var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
       + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
                    img.outerHTML = strNewHTML;

                }
            }
        }

        if (window.addEventListener) {
            window.addEventListener('DOMContentLoaded', correctPNG, false);   //firefox
            window.addEventListener('load', correctPNG, false);
        } else if (window.attachEvent) {
            window.attachEvent('onload', correctPNG);  //IE
        }
    </script>
    <script type="text/javascript">
        String.prototype.trim = function () {
            // 用正则表达式将前后空格，用空字符串替代。
            return this.replace(/(^\s*)|(\s*$)/g, "");
        }
    </script>
</head>
<body style="margin: 0 0 0 0; background-color: #fff; border-left: solid 1px #54a6e2;">
    <form id="form1" runat="server">
    <div>
        <table id="weizhi" width="100%;" style="border: none 0;">
            <tr>
                <td style="height: 2px;">
                </td>
            </tr>
            <tr>
                <td style="border: solid 1px #9fd6ff; background-image: url('../images/snap3.jpg');
                    height: 24px; color: #0930a5;">
                    &nbsp;&nbsp;<img align="absmiddle" src="../images/doc3.gif" />&nbsp;&nbsp;当前位置：查询工单问题
                </td>
            </tr>
            <tr>
                <td style="height: 1px;">
                </td>
            </tr>
        </table>
        <table width="100%" border="0">
            <tr>
                <td>
                    <div style="border: solid 1px #9fd6ff; background-color: #f0f8ff">
                        <table style="width: 100%">
                            <tr>
                                <td style="width: 10px;">
                                </td>
                                <td>
                                    <table border="0" style="width: 100%">
                                        <tr>
                                            <td style="height: 24px; width: 100px" align="left">
                                                派单时间_起：
                                            </td>
                                            <td style="width: 250px">
                                                <input type="text" class="TextBox" id="txtSTART_DATE" style="width: 195px;" runat="server"
                                                    onfocus="WdatePicker({skin:'whyGreen',readOnly:'true'});" />
                                            </td>
                                            <td style="width: 100px">
                                                派单时间_止：
                                            </td>
                                            <td style="width: auto">
                                                <input type="text" class="TextBox" id="txtEND_DATE" runat="server" style="width: 195px;"
                                                    onfocus="WdatePicker({skin:'whyGreen',readOnly:'true'});" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="height: 24px; width: 100px" align="left">
                                                问题类型：
                                            </td>
                                            <td style="width: 250px">
                                                <asp:DropDownList ID="ddlExceptType" runat="server" Width="200px" CssClass="TextBox">
                                                </asp:DropDownList>
                                            </td>
                                            <td style="width: 100px">
                                            </td>
                                            <td style="width: auto">
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="height: 24px;">
                                            </td>
                                            <td style="height: 24px;" colspan="3">
                                                <asp:Button ID="btnSearch" runat="server" Text="&nbsp;&nbsp;查&nbsp;&nbsp;询&nbsp;&nbsp;"
                                                    CssClass="Button" OnClick="btnSearch_ServerClick" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Label
                                                        ID="lblMsg" runat="server" Text="" ForeColor="Red"></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
        </table>
        <table style="width: 100%">
            <tr>
                <td>
                    <div style="border: solid 1px #9fd6ff; background-color: #d4f1f9; border-bottom: none;">
                        <table style="width: 100%; font-family: Arial;">
                            <tr>
                                <td style="height: 20px;">
                                    &nbsp;&nbsp;<img alt="" align="absmiddle" src="../images/181.gif" />&nbsp; <strong>查询结果</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;每页显示<asp:TextBox
                                        runat="server" ID="txtRow" Width="30px" CssClass="TextBox"></asp:TextBox>行 &nbsp;&nbsp;<asp:Label
                                            ID="lblRowCount" runat="server" Text=""></asp:Label>
                                </td>
                                <td style="width: 120px; font-family: Arial">
                                    <asp:ImageButton ID="ImageButton1" runat="server" ImageAlign="Middle" ImageUrl="../images/action_save.gif"
                                        OnClick="ImageButton1_Click" />
                                    <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">导出到excel文件</asp:LinkButton>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="divgv" style="border: solid 1px #9fd6ff; background-color: #f0f8ff;">
                        <table width="100%">
                            <tr>
                                <td style="width: 10px;">
                                </td>
                                <td>
                                    <div id="gv" style="border: solid 1px #9fd6ff; overflow: auto; width: 100%">
                                        <input type="hidden" runat="server" id="hidRowCount" value="0" />
                                        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" CssClass="Table" EmptyDataText="[没有可显示的数据]"
                                            AutoGenerateColumns="False" Width="1750px" AllowSorting="True" BorderStyle="Solid"
                                            CellPadding="3" OnRowDataBound="GridView1_RowDataBound" OnPageIndexChanging="GridView1_PageIndexChanging"
                                            OnRowCommand="GridView1_RowCommand" OnSorting="GridView1_Sorting" PageSize="15">
                                            <PagerSettings FirstPageText="首页" LastPageText="末页" Mode="NextPreviousFirstLast"
                                                NextPageText="下一页" PreviousPageText="上一页" />
                                            <PagerTemplate>
                                                <asp:Label ID="lblPage" runat="server" Text='<%# "共" + hidRowCount.Value  + "条记录&nbsp;&nbsp;第" + (((GridView)Container.NamingContainer).PageIndex + 1)  + "页/共" + (((GridView)Container.NamingContainer).PageCount) + "页" %> '></asp:Label>
                                                &nbsp;<asp:LinkButton ID="lbnFirst" runat="Server" Text="首页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>'
                                                    CommandName="Page" CommandArgument="First"></asp:LinkButton>
                                                &nbsp;<asp:LinkButton ID="lbnPrev" runat="server" Text="上一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>'
                                                    CommandName="Page" CommandArgument="Prev"></asp:LinkButton>
                                                &nbsp;<asp:LinkButton ID="lbnNext" runat="Server" Text="下一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>'
                                                    CommandName="Page" CommandArgument="Next"></asp:LinkButton>
                                                &nbsp;<asp:LinkButton ID="lbnLast" runat="Server" Text="末页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>'
                                                    CommandName="Page" CommandArgument="Last"></asp:LinkButton>
                                                &nbsp;&nbsp;到第&nbsp;<asp:TextBox runat="server" ID="inPageNum" Width="50px" CssClass="TextBox"></asp:TextBox>&nbsp;页
                                                &nbsp;<asp:Button ID="Button1" CommandName="go" runat="server" Text="GO" CssClass="Button" />
                                                <br />
                                            </PagerTemplate>
                                            <PagerStyle BackColor="#C6E3F2" />
                                            <HeaderStyle CssClass="gridtitle" />
                                            <Columns>
                                                <asp:TemplateField HeaderText="工单号" SortExpression="order_number">
                                                    <ItemStyle HorizontalAlign="Left" Width="230px" />
                                                    <ItemTemplate>
                                                        <a href="#" title="点击查看工单详细信息" onclick="window.open('showOrder.aspx?id=<%# Eval("order_id") %>','','location=no,menubar=no,status=no,toolbar=no,resizable=yes,scrollbars=yes,width=1050,height=600');">
                                                            <%# Eval("order_number")%></a>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="工单主题" SortExpression="title">
                                                    <ItemStyle HorizontalAlign="Left" />
                                                    <ItemTemplate>
                                                        <a href="#" title="点击查看工单详细信息" onclick="window.open('showOrder.aspx?id=<%# Eval("order_id") %>','','location=no,menubar=no,status=no,toolbar=no,resizable=yes,scrollbars=yes,width=1050,height=600');">
                                                            <%# Eval("title")%></a>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="area_name" HeaderText="区域" SortExpression="area_name">
                                                    <ItemStyle HorizontalAlign="Left" Width="60px" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="town_name" HeaderText="镇区" SortExpression="town_name">
                                                    <ItemStyle HorizontalAlign="Left" Width="60px" />
                                                </asp:BoundField>
                                                <asp:BoundField DataField="name_remark" HeaderText="签收人" SortExpression="name_remark">
                                                </asp:BoundField>
                                                <asp:BoundField DataField="exception_type" HeaderText="问题类型" SortExpression="exception_type">
                                                </asp:BoundField>
                                                <asp:BoundField DataField="exception" HeaderText="问题描述"></asp:BoundField>
                                            </Columns>
                                            <AlternatingRowStyle BackColor="#f0f8ff" />
                                        </asp:GridView>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 10px;">
                                    &nbsp;
                                </td>
                                <td>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <script type="text/javascript">
                        document.getElementById("gv").style.width = document.documentElement.clientWidth - 50;
                        document.getElementById("gv").style.height = document.documentElement.clientHeight - 180;
                    </script>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
